<style type="text/css">
    .forward_details {
        border: double #ccc 3px;
        padding: 10px 20px;
    }

    ul li.input {
        display:list-item;
        margin-right: 10px;
        font-size: 13px;
        min-width: 160px;
        padding: 5px 0px;list-style-type: disc;

    }
    #footer ul li.input {
        display:inline-block;
        margin-right: 10px;
        font-size: 13px;
        min-width: 160px;
        padding: 5px 0px;list-style-type:disc;

    }


    .flyout_content td {
        padding: 5px;
    }

    .inline-bold {
        display: inline-block;
        font-weight: bold;
        border-bottom: dotted #999 1px;
    }

    .ordered_list {
        list-style-type: decimal;
        padding-left: 10px;
        margin: 5px;
        margin-left: 20px;
    }

    .flyout_content section, .flyout_content section td {
        margin-bottom: 10px;
        font-family:  Tahoma, Geneva, sans-serif;
        font-size: 13px;
    }

    .flyout_content section header {
        padding: 5px;
        margin-bottom: 10px;
        text-align: center;
    }

    .flyout_content  header h3 {
        text-transform: uppercase;
        font-weight: bold;
        font-size: 14px;
        font-family:  Tahoma, Geneva, sans-serif;
        text-align: left;
    }

    .flyout_content footer {
        text-align: center;
    }
    .error_jobsheet{
        font-weight:bold;
        color: red;
    }
    table thead th{
        text-align:left;
    }
    .status{
        font-weight: bolder;
        font-family: "Roman", Arial, Helvetica, sans-serif !important;
        display: inline;
        background-color: #222;
        color: #fff;

    }
    #handler_section{
        font-weight: bolder;
        font-family: "Roman", Arial, Helvetica, sans-serif !important;
        text-transform: uppercase;
        border-top:  dotted #999 1px;

    }
    #label_req{
        margin-bottom: 50px !important;
    }
</style>

<div class="flyout_content">

    <header>
        <h3>GROUND HANDLING REQUEST</h3>
    </header>


    <table width="100%" border="0" cellspacing="0" cellpadding="2">
        <tr>
            <td width="25%">Reference No:</td>
            <td width="25%"><?php echo $req_data[0]['GroundRequest']['ref_no']; ?></td>
            <td width="25%"></td>       <td width="25%"></td>

        </tr>
        <tr>
            <td width="25%">Location:</td>
            <td width="25%"><?php echo $req_data[0]['GroundRequest']['location']; ?></td>
        </tr>
        <tr>
            <td> Date:</td>
            <td><?php echo date("jS F, Y", strtotime($req_data[0]['GroundRequest']['date_created'])); ?></td>
        </tr>

    </table>

    <!--this part is for the request details   --->
    <section>
        <table width="100%" border="0" cellspacing="0" cellpadding="2" id="handler_section">
            <tr>
                <td width="25%">Attn:</td>
                <td width="75%"> 
                    <?php
                    foreach( $handlers as $val ) {
                        if ( $req_data[0]['GroundRequest']['handler_id'] == $val['Handler']['id'] ) {
                            echo $val['Handler']['name'];
                        }
                    }
                    ?>
                </td>
            </tr>
            <tr>
                <td>From:</td>
                <td>Ground Operations</td>
            </tr>
        </table>
    </section>

    <label id="label_req">WE REQUEST YOUR ASSISTANCE WITH THE BELOW FLIGHT:</label>



    <table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
            <td width="150">Operation:</td>
            <td><?php echo $req_data[0]['GroundRequest']['operator']; ?></td>
        </tr>
        <tr>
            <td>AirCraft Type:</td>
            <td><?php echo $req_data[0]['GroundRequest']['type']; ?></td>
        </tr>
        <tr>
            <td>Region:</td>
            <td><?php echo $req_data[0]['GroundRequest']['region']; ?></td>
        </tr>
        <tr>
            <td>Mtow:</td>
            <td><?php echo $req_data[0]['GroundRequest']['mtow']; ?></td>
        </tr>
        <tr>
            <td>Flight No:</td>
            <td>
                <?php echo $req_data[0]['GroundRequest']['flight_no']; ?>
            </td>
        </tr>
        <tr>
            <td>Crew:</td>
            <td><?php echo $req_data[0]['GroundRequest']['crew']; ?></td>
        </tr>
        <tr>
            <td width="25%">Purpose:</td>
            <td><?php echo $req_data[0]['GroundRequest']['purpose']; ?></td>
        </tr>
    </table>



    <section>
        <h4>SCHEDULE</h4>

        <table width="100%" border="0" cellspacing="0" cellpadding="5">
            <thead>
            <th> </th>

            </thead>
            <?php foreach( $grdates as $val ) { ?>
                <tr>
                    <td width="100%">
                        <?php
                        echo date('dMy', strtotime($val['GroundRequestDate']['date_departure'])) . " ETD " . $val['GroundRequestDate']['country_code_etd'] . " " . date('hi', strtotime($val['GroundRequestDate']['date_departure'])) . "Z" . " &nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;" .
                        date('dMy', strtotime($val['GroundRequestDate']['date_arrival'])) . " ETA " . $val['GroundRequestDate']['country_code_eta'] . " " . date('hi', strtotime($val['GroundRequestDate']['date_arrival'])) . "Z" . " " . "(" . $val['GroundRequestDate']['comment'] . ")";
                        ?>
                    </td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
            <?php } ?>

        </table>

    </section>

    <section>
        <h4>WE REQUEST</h4>

        <ul>

            <?php
            foreach( $services as $val ) {
                if ( in_array($val['Service']['id'], $grarray) ) {
                    ?>
                    <li class="input"><?php echo $val['Service']['description']; ?></li>
                    <?php
                }
            }
            ?>

            <li>PLS ADVISE ANY LIMITATIONS, YOU MAY HAVE AT THIS LOCATION.</li>
        </ul>

        <br />
        PLS KINDLY CONFIRM PROVISION OF ALL SERVICES.

    </section>


    <footer>
        <div class="input" style="text-align: left; margin-top: 20px;">
            RGDS, DONATA - CHARLIE TEAM | S.B-MAN (HQ), P. O. Box OS 1734, OSU – ACCRA. GHANA. <br />
            <a href="http://www.sbmangh.com/" target="_blank">www.sbmangh.com</a>
        </div>
    </footer>




</div>

<script>
    $(".print_form").click(function(e){
        window.open($(this).attr("href"));
    });
</script>
